package org.lisen.patterndemo.factory.simplefactory;

public class DuckFactory {

    private DuckFactory(){}

    private static DuckFactory duckFactory = new DuckFactory();

    public static final int WILD_DUCK = 1;

    public static final int RUBBER_DUCK = 2;

    public static final int DONALD_DUCK = 3;

    public static Duck getInstance(int duckType) {
        switch (duckType) {
            case WILD_DUCK:
                return new WildDuck();
            case RUBBER_DUCK:
                return new RubberDuck();
            case DONALD_DUCK:
                return new DonaldDuck();
            default:
                return null;
        }
    }

}
